<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="cn.com.checne.model.domain.UserInfo,cn.com.checne.constants.Constants,cn.com.checne.util.WebUtils" %>
<%@ page import="cn.com.checne.model.domain.RoleInfo,cn.com.checne.model.domain.RightInfo,java.util.List,java.util.ArrayList" %>
<%
UserInfo user = (UserInfo) request.getSession().getAttribute(Constants.SESSIONNAME);
int languageId = (String)request.getSession().getAttribute(Constants.SESSIONLANGUAGE) != null ? Integer.parseInt((String)request.getSession().getAttribute(Constants.SESSIONLANGUAGE)) : 1 ;
String navPath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath() + "/" ;
%>
<%//@ page import="cn.com.chec.console.model.domain.UserInfo,cn.com.chec.console.constants.Constants,cn.com.chec.console.model.domain.WebsiteInfo,cn.com.chec.console.dao.WebsiteInfoDao,java.util.List" %>
<%
/**
String navPath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath() + "/" ;
UserInfo userInfoSessionNAV = (UserInfo)request.getSession().getAttribute(Constants.SESSIONNAME);
List<String> userRightSession = (List<String>)request.getSession().getAttribute(Constants.SESSIORIGHTLIST);
List<WebsiteInfo> websiteInfoList = new WebsiteInfoDao().getSubList(null,0,Integer.MAX_VALUE) ;
**/
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="../../common/tagInclude.jsp"%>
<%@include file="../../common/headerInclude.jsp" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>头部信息--导航条</title>
<style type="text/css">
*{margin:0;padding:0}
html{height:100%;overflow:hidden;}
body{height:100%;}
#welcome{color:#FFF;padding-left:5px;}
#unReadMessage{color:#FFF;padding-left:5px;}
#unReadMsgCount{color:#FFF;padding-left:5px;}
#logout{color:#FFF;padding:0 10px 0 5px;}
#view_index{color:#FFF;}
.menu{padding-left:1em;font-size:12px;font-weight:700;float:left;margin:4px 4px 0 0;list-style:none;}
.menu li{float:left;width:60px;}
.menu li.sep{float:left;height:35px;width:10px;background:url(${basePath}res/jeecms/img/admin/sep.jpg) left 3px no-repeat;}
.menu li a{display:block;height:35px;float:left;line-height:35px;padding:0 14px;color:#000;outline:none;hide-focus:expression(this.hideFocus=true);}
.menu li.current{background:url(${basePath}res/jeecms/img/admin/nav_current.jpg) left top no-repeat;}
.menu li.current a{color:#fff;}
.undis{display:none;}
.dis{display:block;}
</style>

<script type="text/javascript">
	function g(o){
		return document.getElementById(o);
	}
	function HoverLi(m,n,counter){
		for(var i=1;i<=counter;i++){
			g('tb_'+m+i).className='';
		}
		g('tb_'+m+n).className='current';
	}
	function changeLanguage(languageObj) {
		var languageId = languageObj.value ;
		if(languageId == '0'){
			 return ;
		}
		//var url = "${basePath}super/changeLanguage.do?languageId=" + languageId ;
		document.changeLanguageForm.submit();
	}
</script>
</head>

<body>
<div id="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="223">
	<table width="100%" border="0" cellspacing="0" cellpadding="0"  background="${basePath}res/jeecms/img/admin/top_bg.jpg">
      <tr>
        <td><img src="${basePath}res/jeecms/img/admin/logo.png"></td>
      </tr>
      <tr>
        <td height="33" align="center" background="${basePath}res/jeecms/img/admin/time_bg.jpg">
		<img src="${basePath}res/jeecms/img/admin/ico3.jpg">&nbsp;现在时间：
       <script language="javascript">
		var day="";
		var month="";
		var ampm="";
		var ampmhour="";
		var myweekday="";
		var year="";
		mydate=new Date();
		myweekday=mydate.getDay();
		mymonth=mydate.getMonth()+1;
		myday= mydate.getDate();
		year= mydate.getFullYear();
		if(myweekday == 0)
		weekday=" 星期日 ";
		else if(myweekday == 1)
		weekday=" 星期一 ";
		else if(myweekday == 2)
		weekday=" 星期二 ";
		else if(myweekday == 3)
		weekday=" 星期三 ";
		else if(myweekday == 4)
		weekday=" 星期四 ";
		else if(myweekday == 5)
		weekday=" 星期五 ";
		else if(myweekday == 6)
		weekday=" 星期六 ";
		document.write(year+"年"+mymonth+"月"+myday+"日 "+weekday);
	   </script>
       </td>
      </tr>
    </table></td>
    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="15" height="54"><img src="${basePath}res/jeecms/img/admin/top_bg.jpg"></td>
        <td background="${basePath}res/jeecms/img/admin/top_bg.jpg"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="500px" height="30">
				<img src="${basePath}res/jeecms/img/admin/welconlogin-icon.png"><span id="welcome"><%=user.getRealName()%>&nbsp;&nbsp;[<%=user.getRoleInfo().getRoleName()%>]</span>
				<img src="${basePath}res/jeecms/img/admin/loginout-icon.png"><a id="logout" href="${basePath}super/logout.do" target="_top" >注销</a>&nbsp;&nbsp;
				<span id="welcome">首页[<a href="${basePath}cn/" id="logout" target="_blank">中文</a>&nbsp;<a href="${basePath}en/" id="logout" target="_blank">英文</a>]</span>
			</td>
            <td align="right">
	            <form action="${basePath}super/changeLanguage.do" method="get" name="changeLanguageForm" target="mainFrame">
	            	<select name="languageId" onchange="javascript:changeLanguage(this)">
	            		<option value="0">请选择语种</option>
	            		<option value="1" <%=languageId ==1 ? "selected" : "" %>>&nbsp;&nbsp;&nbsp;&nbsp;中文</option>
	            		<option value="2" <%=languageId ==2 ? "selected" : "" %>>&nbsp;&nbsp;&nbsp;&nbsp;英文</option>
	            	</select>
	            </form>
            </td>
            <td width="100">&nbsp;<a id="view_index" href="asdf" target="_blank"></a></td>
          </tr>
        </table></td>
      </tr>
      <tr>
      <%
      	List<String> rights = new ArrayList<String>();
      	int rightsLen = 0 ;
      	int menuTabIndex = 0 ;
      	int menuHovIndex = 0 ;
      	RoleInfo roleInfo = user.getRoleInfo();
		if(roleInfo != null){
			List<RightInfo> list = new ArrayList<RightInfo>();
			if(roleInfo!= null){
				list = roleInfo.getRights();
				if(list != null && list.size() > 0 ){
					for(RightInfo ri : list){
						rights.add(ri.getRightValue());
					}
					rightsLen = rights.size() + 1 ;
					System.out.println(rightsLen);
				}
			}
		}
      %>
        <td><img src="${basePath}res/jeecms/img/admin/top_07.jpg"></td>
        <td background="${basePath}res/jeecms/img/admin/nav_bg.jpg">
		   <ul class="menu">			
			<li class="current" id="tb_1<%=++menuTabIndex%>" onclick="HoverLi(1,<%=++menuHovIndex%>,<%=rightsLen%>);"><a href="${basePath}super/frame/index.do" target="mainFrame">首页</a></li>
			<%if(rights.contains("1")){%>
			<li class="sep"></li><li id="tb_1<%=++menuTabIndex%>" onclick="HoverLi(1,<%=++menuHovIndex%>,<%=rightsLen%>);"><a href="${basePath}super/introduce/index.do" target="mainFrame">概况</a></li>
			<%}
			if(rights.contains("2")){%>
			<li class="sep"></li><li id="tb_1<%=++menuTabIndex%>" onclick="HoverLi(1,<%=++menuHovIndex%>,<%=rightsLen%>);"><a href="${basePath}super/business/index.do" target="mainFrame">业务</a></li>
			<%}
			if(rights.contains("3")){%>
			<li class="sep"></li><li id="tb_1<%=++menuTabIndex%>" onclick="HoverLi(1,<%=++menuHovIndex%>,<%=rightsLen%>);"><a href="${basePath}super/performance/index.do" target="mainFrame">业绩</a></li>
			<%}
			if(rights.contains("4")){%>
			<li class="sep"></li><li id="tb_1<%=++menuTabIndex%>" onclick="HoverLi(1,<%=++menuHovIndex%>,<%=rightsLen%>);"><a href="${basePath}super/news/index.do" target="mainFrame">新闻</a></li>
			<%}
			if(rights.contains("5")){%>
			<li class="sep"></li><li id="tb_1<%=++menuTabIndex%>" onclick="HoverLi(1,<%=++menuHovIndex%>,<%=rightsLen%>);"><a href="${basePath}super/culture/index.do" target="mainFrame">文化</a></li>
			<%}
			if(rights.contains("6")){%>
			<li class="sep"></li><li id="tb_1<%=++menuTabIndex%>" onclick="HoverLi(1,<%=++menuHovIndex%>,<%=rightsLen%>);"><a href="${basePath}super/job/index.do" target="mainFrame">招聘</a></li>
			<%}
			if(rights.contains("10")){%>
			<li class="sep"></li><li id="tb_1<%=++menuTabIndex%>" onclick="HoverLi(1,<%=++menuHovIndex%>,<%=rightsLen%>);"><a href="${basePath}super/post/index.do" target="mainFrame">链接</a></li>
			<%}
			if(rights.contains("7")){%>
			<li class="sep"></li><li id="tb_1<%=++menuTabIndex%>" onclick="HoverLi(1,<%=++menuHovIndex%>,<%=rightsLen%>);"><a href="${basePath}super/user/index.do" target="mainFrame">用户</a></li>
			<%}
			if(rights.contains("8")){%>
			<li class="sep"></li><li id="tb_1<%=++menuTabIndex%>" onclick="HoverLi(1,<%=++menuHovIndex%>,<%=rightsLen%>);"><a href="${basePath}super/sysSetUp/index.do" target="mainFrame">系统</a></li>
			<%}
			if(rights.contains("9")){%>
			<li class="sep"></li><li id="tb_1<%=++menuTabIndex%>" onclick="HoverLi(1,<%=++menuHovIndex%>,<%=rightsLen%>);"><a href="${basePath}super/website/index.do" target="mainFrame">站外</a></li>
			<%}
			%>
			</ul>
		</td>
      </tr>
    </table></td>
  </tr>
</table>
</div>
</body>
</html>